﻿using System;
using UnityEngine;

namespace Utility
{
	// Token: 0x0200040A RID: 1034
	public class ResourceUtility
	{
		// Token: 0x060019DA RID: 6618 RVA: 0x000A61C0 File Offset: 0x000A43C0
		public static UnityEngine.Object CreateInstance(string file)
		{
			UnityEngine.Object @object = Resources.Load(file);
			if (@object == null)
			{
				GlobalData.Debug_LogWarning("找不到:" + file);
			}
			return UnityEngine.Object.Instantiate(@object);
		}

		// Token: 0x060019DB RID: 6619 RVA: 0x000A61F8 File Offset: 0x000A43F8
		public static UnityEngine.Object CreateInstance(string file, string name)
		{
			UnityEngine.Object @object = Resources.Load(file);
			if (@object == null)
			{
				GlobalData.Debug_LogWarning("找不到:" + file);
			}
			@object.name = name;
			return UnityEngine.Object.Instantiate(@object);
		}

		// Token: 0x060019DC RID: 6620 RVA: 0x000A6238 File Offset: 0x000A4438
		public static UnityEngine.Object CreateInstance(string file, Vector3 pos, Quaternion rot)
		{
			UnityEngine.Object @object = Resources.Load(file);
			if (@object == null)
			{
				GlobalData.Debug_LogWarning("找不到:" + file);
			}
			return UnityEngine.Object.Instantiate(@object, pos, rot);
		}

		// Token: 0x060019DD RID: 6621 RVA: 0x000A6270 File Offset: 0x000A4470
		public static Type CreateInstance<Type>(string file) where Type : UnityEngine.Object
		{
			Type type = Resources.Load<Type>(file);
			if (type == null)
			{
				GlobalData.Debug_LogWarning("找不到:" + file);
				return (Type)((object)null);
			}
			return UnityEngine.Object.Instantiate<Type>(type);
		}

		// Token: 0x060019DE RID: 6622 RVA: 0x000A62B4 File Offset: 0x000A44B4
		public static Type CreateInstance<Type>(string file, string name) where Type : UnityEngine.Object
		{
			Type type = Resources.Load<Type>(file);
			if (type == null)
			{
				GlobalData.Debug_LogWarning("找不到:" + file);
			}
			type.name = name;
			return UnityEngine.Object.Instantiate<Type>(type);
		}

		// Token: 0x060019DF RID: 6623 RVA: 0x000A6300 File Offset: 0x000A4500
		public static Type CreateInstance<Type>(string file, Vector3 pos, Quaternion rot) where Type : UnityEngine.Object
		{
			Type type = Resources.Load<Type>(file);
			if (type == null)
			{
				GlobalData.Debug_LogWarning("找不到:" + file);
			}
			return UnityEngine.Object.Instantiate<Type>(type, pos, rot);
		}
	}
}
